package com.ruoyi.datastatistics.mapper;

import com.ruoyi.datastatistics.domain.ElectricityTerminalsFreezeXb;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.datastatistics.domain.TerminalsFreezeXb;
import com.ruoyi.datastatistics.domain.vo.EnergyUseRankVo;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 电冻结数据（设备维度）Mapper接口
 *
 * @author gdqt
 * @date 2025-03-10
 */
public interface ElectricityTerminalsFreezeXbMapper extends BaseMapper<ElectricityTerminalsFreezeXb>
{
    public int deleteElectricityTerminalsFreezeXbByType(@Param("frozenType") String frozenType, @Param("freezeTime") String freezeTime);
    int insertBatch(List<ElectricityTerminalsFreezeXb> list);
    /**
     * 日报表
     * @param freezeTime
     * @return
     */
    int insertByDay(String freezeTime);

    /**
     * 月报表
     * @param freezeTime
     * @return
     */
    int insertByMonth(String freezeTime);
    /**
     * 生成日报表，查询逻辑
     *
     *
     * @return List
     */
    List<ElectricityTerminalsFreezeXb> selectDailyForInsertByDay(@Param("freezeTime") String freezeTime);
    /**
     * 生成月报表，查询逻辑
     *
     *
     * @return List
     */
    @Options(timeout = 10800)
    List<ElectricityTerminalsFreezeXb> selectDailyForinsertByMonthForOne(@Param("frequencyType")String frequencyType,@Param("freezeTime")String freezeTime,@Param("userId")String userId);

    /**
     * 生成月报表，查询逻辑
     *
     *
     * @return List
     */
    List<ElectricityTerminalsFreezeXb> selectDailyForinsertByMonthForTwo(@Param("frequencyType")String frequencyType,@Param("freezeTime")String freezeTime,@Param("userId")String userId);

    /**
     * 生成月报表，查询逻辑
     *
     *
     * @return List
     */
    @Options(timeout = 10800)
    List<ElectricityTerminalsFreezeXb> selectDailyForinsertByMonthForThree(@Param("frequencyType")String frequencyType,@Param("freezeTime")String freezeTime,@Param("userId")String userId,@Param("departureTime")String departureTime);

    List<EnergyUseRankVo> selectUseRank(@Param("tenantId")String tenantId, @Param("month1")String month1, @Param("month2")String month2);

    List<ElectricityTerminalsFreezeXb> getFreezeDayInBigScreen1(@Param("tenantId")String tenantId, @Param("startDay")String startDay, @Param("endDay")String endDay, @Param("areaIds")List<Long> areaIds);
    List<TerminalsFreezeXb> getFreezeDayInBigScreen2(@Param("tenantId")String tenantId, @Param("startDay")String startDay, @Param("endDay")String endDay, @Param("areaIds")List<Long> areaIds);
}
